package fourzerofour.liangjunwei.day01;

import java.util.Scanner;

public class Question9 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个数：");
        int n = scanner.nextInt();
        int sum=0;
        for (int i = 0; i <= n; i=i+1){
            if (i % 2 == 0 ){
                sum = sum + i;
            }
        }
        System.out.println("0到" + n + "之间的所有偶数之和为："+ sum);
    }
}
